﻿@using NewRen.Models;
@using NewRen.Models.ViewModel;
@model IEnumerable<NewRen.Models.Topic>
@{
    Layout = "~/Views/Shared/_Layout_Bbs.cshtml";
    ViewBag.Title = "首页";
}
<input type="hidden" name="name" id="cuserId" value="@((ViewBag.CurrentUser!=null && ViewBag.CurrentUser.UserType==UserType.User)?ViewBag.CurrentUser.ID:"")" />
<input id="sid" value="@ViewBag.SID" type="hidden" />
<div class="container_wrap wrap_990 clearfix">
    <div class="contain_left fr">
        <div class="left_wrap">
            <div class="sidebarplate">
                <div class="sidebarplate_tab">
                    <div class="tab">
                        <span class="on" id="tab_span_1">版块推荐</span>
                        <span class="" id="tab_span_2">板块列表</span>
                    </div>
                </div>
                <div>
                    <ul class="on" id="tab_ul_1">
                        @foreach (Plate item in ViewBag.NewForums)
                        {
                            <li><a href="/Bbs/Forum/@item.ID" target="_blank"><span>@item.Title</span></a></li>
                        }

                    </ul>
                    <ul class="" id="tab_ul_2">
                        @foreach (Plate item in ViewBag.ForumList)
                        {
                            <li><a href="/Bbs/Forum/@item.ID" target="_blank"><span>@item.Title</span></a></li>
                        }
                        @if (ViewBag.ForumList.Count > 7)
                        {
                            <li><a href="/Bbs/PlateList" target="_blank" style="color:black"><span>更多</span></a></li>
                        }
                    </ul>
                </div>
            </div>
        </div>
        <div id="mibbs_sign">
            <div class="mibbs_con" style="margin-bottom:10px;">
                <a class="mibbs_signpanel JD_sign " id="JD_sign">
                    <div class="font" id="sign_font">签到</div>
                    <span class="nums" id="sign_nums">连续0天</span>
                    <div class="fblock">
                        <div class="all" id="sign_all"></div>
                        <div class="line" id="sign_line">
                            <span style="font-size:12px;">签到看排名</span>
                        </div>
                    </div>
                </a>
            </div>
        </div>

        <a href="http://bbs.xiaomi.cn/task/list" target="_Blank"><img src=""></a>
        <div class="left_wrap">
            <div class="con">
                <ul class="xm_index_info">
                    <li><span class="num">@ViewBag.TopicToDayNum</span><span class="txt">今日发帖数</span></li>
                    <li><span class="num">@ViewBag.TopicYesterDayNum</span><span class="txt">昨日发帖数</span></li>
                    <li><span class="num">@ViewBag.TopicsNum</span><span class="txt">论坛总发帖数</span></li>
                    <li><span class="num">@ViewBag.UserNum</span><span class="txt">论坛会员数</span></li>
                </ul>
                <div class="hotspot">
                    <h3>热门主题</h3>
                </div>
                <div class="shareActive">
                    @foreach (Topic item in ViewBag.HotsPot)
                    {
                        <a href="/Bbs/Show/@item.ID" target="_blank" class="shareActive_img">
                            <!--<img src="">-->
                            <span class="shareActive_txt">@item.Title</span>
                        </a>
                    }
                </div>
            </div>
        </div>
        <div class="left_wrap">
            <div class="con">
                <div class="hotspot">
                    <h3>推荐关注</h3>
                </div>
                <div class="shareActive">
                    @foreach (Plate item in ViewBag.Collect)
                    {
                        <a href="/Bbs/Show/@item.ID" target="_blank" class="shareActive_img">
                            <!--<img src="">-->
                            <span class="shareActive_txt">@item.Title</span>
                        </a>
                    }
                </div>
            </div>
        </div>
    </div>
    <div class="contain_right fl clearfix ">
        <div class="hostplate">
            <span class="name">热门版块:</span>
            <ul class="hostplate_con clearfix">
                @foreach (Plate item in ViewBag.HotForums)
                {
                    <li class="list_item">
                        <a href="/Bbs/Forum/@item.ID" class="list_item_con">
                            <span class="txt">@item.Title</span>
                        </a>
                    </li>
                }
            </ul>
        </div>
        <div class="theme">
            <div class="theme_con">
                <div class="theme_nav">
                    <input type="hidden" id="theme_nav" value="@ViewBag.theme_nav" />
                    <a href="/Bbs/Index?theme_nav=1" class="theme_nav_list @(ViewBag.ThemeNav==1?"current":"")">推荐<span class="num">@ViewBag.TopicsHotNum</span></a>
                    <a href="/Bbs/Index?theme_nav=2" class="theme_nav_list @(ViewBag.ThemeNav==2?"current":"")">最新主题<span class="num">@ViewBag.TopicsNewNum</span></a>
                    <a id="go_add_theme" class="btn theme_nav_btn">发表新主题</a>
                </div>
                <ul class="theme_con_index clearfix current">
                    @foreach (Topic item in Model)
                    {
                        <li class="theme_list clearfix" u-id="@item.ID">
                            <div class="theme_list_img">
                                <a href="/Bbs/Show/@item.ID" class="headportrait" target="_blank">
                                    <img class="user_head" src="/User/ShowPicture/@item.UserID">
                                </a>
                            </div>
                            <div class="theme_list_con">
                                <div class="title">
                                    @if ((item.Browses + item.Replies.Count()) > 500)
                                    {
                                        <a href="/Bbs/Show/@item.ID" class="title_name title_show" target="_blank">@item.Title</a>
                                    }
                                    else if (item.Browses > 100)
                                    {
                                        <a href="/Bbs/Show/@item.ID" class="title_name title_hot" target="_blank">@item.Title</a>
                                    }
                                    else if (item.Top)
                                    {
                                        <a href="/Bbs/Show/@item.ID" class="title_name title_top" target="_blank">@item.Title</a>
                                    }
                                    else if (item.IsOfficeIdentified)
                                    {
                                        <a href="/Bbs/Show/@item.ID" class="title_name title_office" target="_blank">@item.Title</a>
                                    }
                                    else
                                    {
                                        <a href="/Bbs/Show/@item.ID" class="title_name" target="_blank">@item.Title</a>
                                    }

                                    @if (item.Browses > 100)
                                    {
                                        <img class="stamp" src="/images/Hot.png" />
                                    }
                                    @if (item.IsOfficeIdentified)
                                    {
                                        <img class="stamp" src="~/images/Office.png" />
                                    }
                                    @if ((item.Browses + item.Replies.Count()) > 500)
                                    {
                                        <img class="stamp" src="~/images/Show.png" />
                                    }
                                </div>
                                <div class="auth_msg clearfix">
                                    <a href="/Bbs/Forum/@item.PlateID" class="user_name" target="_blank">@item.Plate.Title</a>
                                    <span class="time txt">
                                        @item.Time.ToString("yyyy-MM-dd HH:mm:s")
                                    </span>
                                    @if (item.LastReply != null)
                                    {
                                        <span class="lastreply txt">
                                            最后回复:@Convert.ToDateTime(item.LastReply).ToString("yyyy-MM-dd HH:mm:s")
                                        </span>
                                    }
                                    @if (item.Top)
                                    {
                                        <span class="stick txt">·置顶</span>
                                    }
                                    <span class="bbs-numb msg"><i></i>@item.Replies.Count()</span>
                                    <span class="bbs-numb view"><i></i>@item.Browses</span>
                                </div>
                            </div>
                        </li>
                    }
                </ul>
                <div class="base_widget_paging">
                    @Html.MakePager()
                </div>
            </div>
        </div>
    </div>
</div>
